package com.zhixin.zhixinmall.entity.pojo;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zhixin.zhixinmall.config.CustomDateTimeSerializer;

import lombok.Data;

/**
 * @author cyc
 * @date 2023/10/08 15:03:45
 */
@Data
@TableName("t_wxuserinfo")
public class Wxuserinfo {
    /**
     * 主键id，自增
     */
    @TableId
    private Long id;

    /**
     * openid
     */
    @TableField("openid")
    private String openid;

    /**
     * 昵称
     */
    @TableField("nickName")
    private String nickName;

    /**
     * 头像
     */
    @TableField("avatarUrl")
    private String avatarUrl;

    /**
     * 首次注册时间
     */
    @TableField(value = "registerDate", fill = FieldFill.INSERT)
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    private LocalDateTime registerDate;

    /**
     * 最后登录时间
     */
    @TableField(value = "lastLoginDate", fill = FieldFill.INSERT_UPDATE)
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    private LocalDateTime lastLoginDate;

    /**
     * 微信小程序传递的code
     */
    @TableField(select = false, exist = false)
    private String code;
}
